﻿using Core.SimpleTemp.Repositories.Internal;
using Core.Toolkit.Core.Api;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;

namespace Core.SimpleTemp.Mvc.Api
{
    [Route("api/[controller]")]
    [EnableCors("any")]
    //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        CoreDBContext _coreDBContext;
        ExcelHelp _excelHelp;
        public ValuesController(CoreDBContext coreDBContext, ExcelHelp excelHelp)
        {
            _coreDBContext = coreDBContext;
            _excelHelp = excelHelp;
        }

        // GET api/values
        [HttpGet]
        public ActionResult<string> Get()
        {
        //    //创建ppt对象
        //    Presentation ppt = new Presentation();
        //    //加载文件
        //    ppt.LoadFromFile("D:\\Sample.pptx");
        //    //保存到HTML文件
        //    ppt.SaveToFile("D:\\Sample.html", FileFormat.Html);

            //return $"Hello Core.SimpleTemp Ip {Request.GetIp()}";
            return "";
        }

        // GET api/values/5
        [HttpGet("{id}")]
        public ActionResult<string> Get(Guid id)
        {
            //var ui = _coreDBContext.Set<SysUserInfor>().Include(a=>a.Touxiang).SingleOrDefault(u => u.Id == id);
            return this.JsonSuccess();
        }

        // POST api/values
        [HttpPost]
        public void Post([FromBody] string value)
        {
        }

        // PUT api/values/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }

        // DELETE api/values/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }




    }
    
}